package com.sh.caryr.erp.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotations.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.sh.caryr.erp.util.DateUtils;
import com.sh.caryr.erp.util.ERPConstants;
import com.sh.caryr.erp.util.UtilityTool;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@NoArgsConstructor
public class BaseEntity {

    @Excel(name = "系统交易号")
    @JsonSerialize(using = ToStringSerializer.class)
    protected Long id;

    @Excel(name = "公司代码", isImportField = "true_st")
    protected String coco;

    protected int isActive = ERPConstants.ENITYT_ACTIVE;

    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtils.DATE_FORMAT_FULL)
    private Date updateAt;

    @JsonSerialize(using = ToStringSerializer.class)
    protected Long updateBy;

    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtils.DATE_FORMAT_FULL)
    protected Date createAt;

    @JsonSerialize(using = ToStringSerializer.class)
    protected Long createBy;

    @TableField(exist = false)
    protected String creatorName;
}
